#coding:utf-8
#dictionary
#弁当の購入 N.SUN 2023/1/1
Bento = {"唐揚げ弁当":450, "日替わり弁当":500,"とんかつ弁当":450,"チキン南蛮弁当":450}
sidemenu = dict(カツ丼=450,ソースカツ丼=450,ホットドック=200,焼きそばパン=250)
mycart ={}
def chooseOpt():
print('''
1: 弁当一覧
2: 弁当を選ぶ
3: カートを確認
4: 精算
5: おわり
''')
while True:
chooseOpt()
opt = input("オプションを選んでください: ")
if opt in ['1','1']:
for key in Bento:
print(key,":",Bento[key],"円")
for key in sidemenu:
print(key,":",sidemenu[key],"円")
elif opt in ['2', '2']:
name = input("弁当の名前を: ")
number = int(input("個数を: "))
mycart[name] = number
elif opt in ['3','3']:
for key in mycart:
print(key,":",mycart[key],"個")
elif opt in ['4','4']:
total = 0
for item in mycart:
if item in Bento:
total += mycart[item]*Bento[item]
elif item in sidemenu:
total += mycart[item]*sidemenu[item]
print("総額=",total,"円")
elif opt in ['5','5']:
print("ありがとうございました。")
break